package com.ce.pms.occupation.service.impl;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.util.Assert;

import com.ce.pms.base.service.impl.PmsBaseServiceImpl;
import com.ce.pms.common.model.HmEmployeeDomain;
import com.ce.pms.common.model.SysrefcodeDO;
import com.ce.pms.common.service.ICodingGeneratorService;
import com.ce.pms.exception.BusinessException;
import com.ce.pms.occupation.dao.ICompletePerfectItemDao;
import com.ce.pms.occupation.dao.IPerfectItemDispatchDao;
import com.ce.pms.occupation.dao.IPerfectItemRequisitionDao;
import com.ce.pms.occupation.dao.IPerfectItemTrackDao;
import com.ce.pms.occupation.model.CompletePerfectItemDO;
import com.ce.pms.occupation.model.PerfectItemDispatchDO;
import com.ce.pms.occupation.model.PerfectItemRequisitionDO;
import com.ce.pms.occupation.model.PerfectItemTrackDO;
import com.ce.pms.occupation.service.IPerfectItemDispatchService;
import com.ce.pms.occupation.service.IPerfectItemRequisitionService;
import com.ce.pms.occupation.service.IPerfectItemTrackService;
import com.ce.pms.occupation.vo.CompletePerfectItemVO;
import com.ce.pms.occupation.vo.PerItemDispSearchVO;
import com.ce.pms.occupation.vo.PerfectItemDispatchVO;
import com.ce.pms.occupation.vo.PerfectItemRequisitionVO;
import com.ce.pms.occupation.vo.PerfectItemTrackVO;
import com.ce.pms.system.occupation.model.ContractorInfoConfigDO;
import com.ce.util.BeanUtil;
import com.ce.util.BlankUtil;
import com.sitechasia.webx.core.support.Page;
import com.sitechasia.webx.core.utils.base.PopulateUtil;
/**
 * 功能描述: 整改项目派工Service实现类
 * <p>版权所有：中企动力
 * <p>未经本公司许可，不得以任何方式复制或使用本程序任何部分
 *
 * @author  胡煦
 * Create on:2008-12-31
 * Edit author:
 * Edit on:
 * 修改原因：

 */

public class PerfectItemDispatchServiceImpl extends PmsBaseServiceImpl
		implements IPerfectItemDispatchService {

	/**
	 * 方法描述: 分页查询所有整改项目派工
	 * @author 胡煦
	 * Create on:2008-12-29
	 * @param perItemDispSearchVO
	 * @return 返回当前页的查询结果
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public Page queryPerfectItemDispatchVOByPage(PerItemDispSearchVO perItemDispSearchVO){
		Page page = perfectItemDispatchDao.queryPerfectItemDispatchDOByPage(perItemDispSearchVO);
		List<PerfectItemDispatchVO> VOlist = this.changelistDOToVO(page.getResult());
		page.setResult(VOlist);
		return page;
	}
	/**
	 * 方法描述: 根据ID查询整改项目派工VO
	 * @author 胡煦
	 * Create on:2008-12-29
	 * @param id
	 * @return PerfectItemDispatchVO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public PerfectItemDispatchVO queryperfectItemDispatchVOById(Long id) {
		Assert.notNull(id,"id isnot Null");
		PerfectItemDispatchDO perfectItemDispatchDO = perfectItemDispatchDao.findById(id);
		return this.assembleD2V(perfectItemDispatchDO, null);
	}
	/**
	 * 方法描述: 增加整改项目派工方法
	 * @author 胡煦
	 * Create on:2008-12-30
	 * @param perfectItemDispatchVO
	 * @return perfectItemDispatchVO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public PerfectItemDispatchVO addPerfectItemDispatch(PerfectItemDispatchVO perfectItemDispatchVO){
		Assert.notNull(perfectItemDispatchVO);
		Assert.notNull(perfectItemDispatchVO.getContractorInfoConfigId(),"承包商设置Id不能为空");
		//不存在派工项目，不得派工
		this.checkAddIsTrue(perfectItemDispatchVO);
		PerfectItemDispatchDO perfectItemDispatchDO = this.assembleV2D(perfectItemDispatchVO, null);
		perfectItemDispatchDO = perfectItemDispatchDao.saveObject(perfectItemDispatchDO) ;
		//因为是双向级联，所以这里需要写入派工ID
		perfectItemDispatchDO.setPerfectItemRequisitions(this.changeVo2DoOfSet(perfectItemDispatchVO.getPerfectItemRequisitions(),perfectItemDispatchDO.getKeyword()));
		perfectItemDispatchVO.setKeyword(perfectItemDispatchDO.getKeyword());
		return perfectItemDispatchVO;
	}
	/**
	 * 方法描述: 新增整改项目派工验证方法
	 * 不存在派工项目，不能派工
	 * @author 胡煦
	 * Create on:2008-12-31
	 * @param perfectItemRequisitionId
	 * @return void
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public void checkAddIsTrue(PerfectItemDispatchVO perfectItemDispatchVO){
		Assert.notNull(perfectItemDispatchVO);
		//不存在派工项目，不能派工
		if(perfectItemDispatchVO.getPerfectItemRequisitions().size() < 1){
			throw new BusinessException("occupation:occupation_perfectItemDispatch_add_exception", BusinessException.WARNING);
		}
	}
	/**
	 * 方法描述: 修改整改项目派工验证方法
	 * 派工单已经完工，不可修改
	 * @author 胡煦
	 * Create on:2008-12-31
	 * @param perfectItemDispatchId
	 * @return PerfectItemDispatchDO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public PerfectItemDispatchDO checkEditIsTrue(Long perfectItemDispatchId){
		Assert.notNull(perfectItemDispatchId,"id isnot Null");
		PerfectItemDispatchDO dispatchDO = perfectItemDispatchDao.findById(perfectItemDispatchId);
		//派工单已经完工，不可修改
		if(this.checkIsCompleted(dispatchDO.getPerfectItemRequisitions())){
			throw new BusinessException("occupation:occupation_perfectItemDispatch_edit_exception", BusinessException.WARNING);
		}
		return dispatchDO;
	}

	/**
	 * 方法描述: 修改整改项目派工方法
	 * @author 胡煦
	 * Create on:2008-12-30
	 * @param perfectItemDispatchVO
	 * @return perfectItemDispatchVO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public PerfectItemDispatchVO editPerfectItemDispatch(PerfectItemDispatchVO perfectItemDispatchVO){
		Assert.notNull(perfectItemDispatchVO);
		this.checkAddIsTrue(perfectItemDispatchVO);
		PerfectItemDispatchDO perfectItemDispatchDO = this.checkEditIsTrue(perfectItemDispatchVO.getKeyword());
		//将整改项目Set中的项目状态设置为未派工
		Set<PerfectItemRequisitionDO> set = perfectItemDispatchDO.getPerfectItemRequisitions();
		if(!BlankUtil.isBlank(set)){
			this.doSetToZero(perfectItemDispatchDO.getPerfectItemRequisitions());
			perfectItemDispatchDO.setPerfectItemRequisitions(null);
		}
		this.assembleV2D(perfectItemDispatchVO, perfectItemDispatchDO);
		perfectItemDispatchDO = perfectItemDispatchDao.updateObject(perfectItemDispatchDO);
		this.getDate();
		return perfectItemDispatchVO;
	}
	/**
	 * 方法描述: 刪除整改项目派工验证方法
	 * 删除派工单失败(该派工单中存在已完工的项目)
	 * @author 胡煦
	 * Create on:2008-12-31
	 * @param perfectItemDispatch Id
	 * @return PerfectItemDispatchDO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public PerfectItemDispatchDO checkDeleteIsTrue(Long perfectItemDispatchId){
		Assert.notNull(perfectItemDispatchId,"id isnot Null");
		PerfectItemDispatchDO perfectItemDispatchDO = perfectItemDispatchDao.findById(perfectItemDispatchId);
		if(this.checkIsHasCompletedItem(perfectItemDispatchDO.getPerfectItemRequisitions())){
			throw new BusinessException("occupation:occupation_perfectItemDispatch_delete_exception", BusinessException.WARNING);
		}
		return perfectItemDispatchDO;
	}
	/**
	 * 方法描述: 刪除整改项目派工下的派工项目验证方法
	 * 已经完工或跟进的申报项目不得删除
	 * @author 胡煦
	 * Create on:2008-12-31
	 * @param perfectItemDispatchId
	 * @return void
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public void checkDeletePerfectItemIsTrue(Long perfectItemRequisitionId){
		Assert.notNull(perfectItemRequisitionId,"id isnot Null");
		PerfectItemRequisitionDO perfectItemRequisitionDO = perfectItemRequisitionDao.findById(perfectItemRequisitionId);
		PerfectItemTrackDO completePerfTrack = perfectItemTrackDao.queryCompletePerfectItemTrack(perfectItemRequisitionId);
		//已经完工或跟进的申报项目不得删除
		if(SysrefcodeDO.CONSTANTS_DIGITAL_ONE.equals(perfectItemRequisitionDO.getCompleteYn())||
				!BlankUtil.isBlank(completePerfTrack)){
			throw new BusinessException("occupation:occupation_perfectItemTrack_requisition_delete_exception", BusinessException.WARNING);
		}
	}
	/**
	 * 方法描述: 删除整改项目派工方法
	 * @author 胡煦
	 * Create on:2008-12-30
	 * @param perfectItemDispatchId
	 * @return boolean
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public boolean deletePerfectItemDispatch(Long perfectItemDispatchId){
		Assert.notNull(perfectItemDispatchId,"id isnot Null");
		//删除派工单失败(该派工单中存在已完工的项目)
		PerfectItemDispatchDO dispatchDO = this.checkDeleteIsTrue(perfectItemDispatchId);
		try {
			this.doSetToZero(dispatchDO.getPerfectItemRequisitions());
			perfectItemDispatchDao.deleteObjectById(perfectItemDispatchId);
			return true;
		} catch (RuntimeException e) {
			e.printStackTrace();
			throw new BusinessException("occupation:system_delete_inused_exception", BusinessException.WARNING);
		}
	}
	/**
	 * 方法描述: 完工登记方法
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param completePerfectItemVO
	 * @return boolean
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public boolean registerCompPerItem(CompletePerfectItemVO  completePerfectItemVO){
		Assert.notNull(completePerfectItemVO);

		if(!BlankUtil.isBlank(completePerfectItemVO.getPerItemReqIdSet())){
			for(Long id : completePerfectItemVO.getPerItemReqIdSet()){
				//插入完工登记记录
				CompletePerfectItemDO completePerfectItemDO = new CompletePerfectItemDO();
				BeanUtil.convertVoAsDo(completePerfectItemVO, completePerfectItemDO);
				completePerfectItemDO.setEmployee(new HmEmployeeDomain(completePerfectItemVO.getTrackerId()));
				completePerfectItemDO.setPerfectItemDispatch(new PerfectItemDispatchDO(completePerfectItemVO.getPerfectItemDispatchId()));
				completePerfectItemDO.setPerfectItemRequisitionId(id);
				completePerfectItemDao.saveObject(completePerfectItemDO);
				//插入项目跟进记录
				PerfectItemTrackVO perfectItemTrackVO = new PerfectItemTrackVO();
				BeanUtil.convertVoAsDo(completePerfectItemVO, perfectItemTrackVO);
				perfectItemTrackVO.setPerfectItemRequisitionId(id);
				perfectItemTrackService.addPerfectItemTrack(perfectItemTrackVO);
				//将项目的完工状态更新为已经完工
				PerfectItemRequisitionDO itemRequisitionDO = perfectItemRequisitionDao.findById(id);
				itemRequisitionDO.setCompleteYn(SysrefcodeDO.CONSTANTS_DIGITAL_ONE);
				perfectItemRequisitionDao.saveOrUpdateObject(itemRequisitionDO);
			}
		}
		return true;
	}

	/**
	 * 方法描述: 生成入伙派工单单号.规则如下
	 * PK+系统当前年月日+三位流水号
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param
	 * @return String
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	public String generateOccupationCoding(){
		return codingGeneratorService.generateOccupationCoding();
	}

	/**
	 * 方法描述: PerfectItemDispatchDO to PerfectItemDispatchVO
	 * @author 胡煦
	 * Create on:2008-12-30
	 * @param perfectItemDispatchDO,perfectItemDispatchVO
	 * @return PerfectItemDispatchVO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private PerfectItemDispatchVO assembleD2V(PerfectItemDispatchDO perfectItemDispatchDO,PerfectItemDispatchVO perfectItemDispatchVO){
		if(BlankUtil.isBlank(perfectItemDispatchDO)){
			return null;
		}
		if(BlankUtil.isBlank(perfectItemDispatchVO)){
			perfectItemDispatchVO = new PerfectItemDispatchVO();
		}
		PopulateUtil.populate(perfectItemDispatchDO, perfectItemDispatchVO);
		Set<PerfectItemRequisitionDO> perfectItemReqDOSet = perfectItemDispatchDO.getPerfectItemRequisitions();
		if(!BlankUtil.isBlank(perfectItemReqDOSet)){
			if(this.checkIsCompleted(perfectItemReqDOSet)){
				perfectItemDispatchVO.setCompleteStatuz(sysrefcodeDao.getSysrefCodesByCode(SysrefcodeDO.OM_COMPLETE_STATE, SysrefcodeDO.OM_COMPLETE_STATE_IS).getValue());
				perfectItemDispatchVO.setCompleteStatuzName(sysrefcodeDao.getSysrefCodesByCode(SysrefcodeDO.OM_COMPLETE_STATE, SysrefcodeDO.OM_COMPLETE_STATE_IS).getName());
			}else{
				perfectItemDispatchVO.setCompleteStatuz(sysrefcodeDao.getSysrefCodesByCode(SysrefcodeDO.OM_COMPLETE_STATE, SysrefcodeDO.OM_COMPLETE_STATE_NO).getValue());
				perfectItemDispatchVO.setCompleteStatuzName(sysrefcodeDao.getSysrefCodesByCode(SysrefcodeDO.OM_COMPLETE_STATE, SysrefcodeDO.OM_COMPLETE_STATE_NO).getName());
			}
		}
		perfectItemDispatchVO.setPerfectItemRequisitions(this.changeDo2VoOfSet(perfectItemReqDOSet));
		if(!BlankUtil.isBlank(perfectItemDispatchDO.getContractorInfoConfig())){
			perfectItemDispatchVO.setContractorInfoConfigId(perfectItemDispatchDO.getContractorInfoConfig().getKeyword());
			perfectItemDispatchVO.setContractorInfoConfigName(perfectItemDispatchDO.getContractorInfoConfig().getContractorInfoName());
		}
		return perfectItemDispatchVO;
	}
	/**
	 * 方法描述:perfectItemDispatchVO to PerfectItemDispatchDO
	 * @author 胡煦
	 * Create on:2008-12-30
	 * @param perfectItemDispatchVO,perfectItemDispatchDO
	 * @return PerfectItemDispatchDO
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private PerfectItemDispatchDO assembleV2D(PerfectItemDispatchVO perfectItemDispatchVO,PerfectItemDispatchDO perfectItemDispatchDO){
		if(BlankUtil.isBlank(perfectItemDispatchDO)){
			perfectItemDispatchDO = new PerfectItemDispatchDO();
		}
		BeanUtil.convertVoAsDo(perfectItemDispatchVO, perfectItemDispatchDO);
		perfectItemDispatchDO.setContractorInfoConfig(new ContractorInfoConfigDO(perfectItemDispatchVO.getContractorInfoConfigId()));
		if(!BlankUtil.isBlank(perfectItemDispatchVO.getKeyword())){
			perfectItemDispatchDO.setPerfectItemRequisitions(this.changeVo2DoOfSet(perfectItemDispatchVO.getPerfectItemRequisitions(),perfectItemDispatchVO.getKeyword()));
		}else{
			perfectItemDispatchDO.setPerfectItemRequisitions(this.changeVo2DoOfSet(perfectItemDispatchVO.getPerfectItemRequisitions(),null));
		}
		return perfectItemDispatchDO;
	}
	/**
	 * 方法描述: 验证整改派工是否已经完工
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param set
	 * @return boolean
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private boolean checkIsCompleted(Set<PerfectItemRequisitionDO> set){
		if(set.size() < 1){
			return false;
		}
		for(PerfectItemRequisitionDO itemRequisitionDO : set){
			if(SysrefcodeDO.CONSTANTS_DIGITAL_ZERO.equals(itemRequisitionDO.getCompleteYn())||BlankUtil.isBlank(itemRequisitionDO.getCompleteYn())){
				return false;
			}
		}
		return true;
	}
	/**
	 * 方法描述: 验证整改派工是否存在已经完工的项目
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param set
	 * @return boolean
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private boolean checkIsHasCompletedItem(Set<PerfectItemRequisitionDO> set){
		if(set.size() < 1){
			return false;
		}
		for(PerfectItemRequisitionDO itemRequisitionDO : set){
			if(SysrefcodeDO.CONSTANTS_DIGITAL_ONE.equals(itemRequisitionDO.getCompleteYn())){
				return true;
			}
		}
		return false;
	}
	/**
	 * 方法描述: perfectItemReqDOSet to perfectItemReqVOSet
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param perfectItemReqDOSet , perfectItemReqVOSet
	 * @return Set<PerfectItemRequisitionVO>
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private Set<PerfectItemRequisitionVO> changeDo2VoOfSet(Set<PerfectItemRequisitionDO> perfectItemReqDOSet){
		if(BlankUtil.isBlank(perfectItemReqDOSet)){
			return null;
		}
		Set<PerfectItemRequisitionVO> perfectItemReqVOSet = new HashSet<PerfectItemRequisitionVO>();
		for(PerfectItemRequisitionDO itemRequisitionDO : perfectItemReqDOSet){
			perfectItemReqVOSet.add(perfectItemRequisitionService.queryPerfectItemRequisitionVOById(itemRequisitionDO.getKeyword()));
		}
		return perfectItemReqVOSet;
	}
	/**
	 * 方法描述: perfectItemReqVOSet to perfectItemReqDOSet
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param perfectItemReqVOSet,perfectItemReqDOSet
	 * @return Set<PerfectItemRequisitionDO>
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private Set<PerfectItemRequisitionDO> changeVo2DoOfSet(Set<PerfectItemRequisitionVO> perfectItemReqVOSet,Long perfectItemDispatchId){
		if(BlankUtil.isBlank(perfectItemReqVOSet)){
			return null;
		}
		Set<PerfectItemRequisitionDO> perfectItemReqDOSet = new HashSet<PerfectItemRequisitionDO>();
		for(PerfectItemRequisitionVO itemRequisitionVO : perfectItemReqVOSet){
			PerfectItemRequisitionDO itemRequisitionDO = perfectItemRequisitionDao.findById(itemRequisitionVO.getKeyword());
			itemRequisitionDO.setDispatchYn(SysrefcodeDO.CONSTANTS_DIGITAL_ONE);
			if(!BlankUtil.isBlank(perfectItemDispatchId)){
				itemRequisitionDO.setPerfectItemDispatch(new PerfectItemDispatchDO(perfectItemDispatchId));
			}
			perfectItemRequisitionDao.updateObject(itemRequisitionDO);
			perfectItemReqDOSet.add(itemRequisitionDO);
		}
		return perfectItemReqDOSet;
	}
	/**
	 * 方法描述: 将整改项目Set中的项目状态设置为未派工
	 * @author 胡煦
	 * Create on:2009-1-4
	 * @param perfectItemReqVOSet
	 * @return void
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private void doSetToZero(Set<PerfectItemRequisitionDO> perfectItemReqDOSet){
		if(!BlankUtil.isBlank(perfectItemReqDOSet)){
			for(PerfectItemRequisitionDO itemRequisitionDO : perfectItemReqDOSet){
				itemRequisitionDO.setDispatchYn(SysrefcodeDO.CONSTANTS_DIGITAL_ZERO);
				itemRequisitionDO.setPerfectItemDispatch(null);
				perfectItemRequisitionDao.updateObject(itemRequisitionDO);
			}
		}
	}
//	/**
//	 * 方法描述: 将整改项目Set的状态设置为已派工
//	 * @author 胡煦
//	 * Create on:2009-1-4
//	 * @param perfectItemReqVOSet
//	 * @return void
//	 * Edit author:
//	 * Edit on:
//	 * 修改原因：
//	 */
//	private void doSetToOne(Set<PerfectItemRequisitionVO> perfectItemReqVOSet){
//		for(PerfectItemRequisitionVO itemRequisitionVO : perfectItemReqVOSet){
//			PerfectItemRequisitionDO itemRequisitionDO = perfectItemRequisitionDao.findById(itemRequisitionVO.getKeyword());
//			itemRequisitionDO.setDispatchYn(SysrefcodeDO.CONSTANTS_DIGITAL_ONE);
//			perfectItemRequisitionDao.updateObject(itemRequisitionDO);
//		}
//	}

	/**
	 * 方法描述:DOlist to VOlist
	 * @author 胡煦
	 * Create on:2008-12-30
	 * @param DOlist
	 * @return List<perfectItemDispatchVO>
	 * Edit author:
	 * Edit on:
	 * 修改原因：
	 */
	private List<PerfectItemDispatchVO> changelistDOToVO(List<PerfectItemDispatchDO> DOlist){
		if(DOlist.size() < 1){
			return null;
		}
		List<PerfectItemDispatchVO> VOlist = new ArrayList<PerfectItemDispatchVO>();
		for(PerfectItemDispatchDO perfectItemDispatchDO : DOlist){
			VOlist.add(this.assembleD2V(perfectItemDispatchDO, null));
		}
		return VOlist;
	}
	private IPerfectItemDispatchDao perfectItemDispatchDao;
	private IPerfectItemRequisitionService perfectItemRequisitionService;
	private IPerfectItemTrackService perfectItemTrackService;
	private IPerfectItemTrackDao perfectItemTrackDao;
	private IPerfectItemRequisitionDao perfectItemRequisitionDao;
	private ICodingGeneratorService codingGeneratorService;
	private ICompletePerfectItemDao completePerfectItemDao;
	/**
	 * @param perfectItemDispatchDao the perfectItemDispatchDao to set
	 */
	public void setPerfectItemDispatchDao(
			IPerfectItemDispatchDao perfectItemDispatchDao) {
		this.perfectItemDispatchDao = perfectItemDispatchDao;
	}
	/**
	 * @param perfectItemRequisitionService the perfectItemRequisitionService to set
	 */
	public void setPerfectItemRequisitionService(
			IPerfectItemRequisitionService perfectItemRequisitionService) {
		this.perfectItemRequisitionService = perfectItemRequisitionService;
	}
	/**
	 * @param perfectItemRequisitionDao the perfectItemRequisitionDao to set
	 */
	public void setPerfectItemRequisitionDao(
			IPerfectItemRequisitionDao perfectItemRequisitionDao) {
		this.perfectItemRequisitionDao = perfectItemRequisitionDao;
	}
	/**
	 * @param codingGeneratorService the codingGeneratorService to set
	 */
	public void setCodingGeneratorService(
			ICodingGeneratorService codingGeneratorService) {
		this.codingGeneratorService = codingGeneratorService;
	}
	/**
	 * @param completePerfectItemDao the completePerfectItemDao to set
	 */
	public void setCompletePerfectItemDao(
			ICompletePerfectItemDao completePerfectItemDao) {
		this.completePerfectItemDao = completePerfectItemDao;
	}
	/**
	 * @param perfectItemTrackService the perfectItemTrackService to set
	 */
	public void setPerfectItemTrackService(
			IPerfectItemTrackService perfectItemTrackService) {
		this.perfectItemTrackService = perfectItemTrackService;
	}
	/**
	 * @param perfectItemTrackDao the perfectItemTrackDao to set
	 */
	public void setPerfectItemTrackDao(IPerfectItemTrackDao perfectItemTrackDao) {
		this.perfectItemTrackDao = perfectItemTrackDao;
	}
}
